<template>
	<view>
		<u-popup v-model="couponShow" mode="bottom" width="750rpx" height="1080rpx" :border-radius="16"
			:mask-close-able="false">
			<view class="coupon_pup">
				<view class="header_title">
					<view class="left">
						{{title}}
					</view>
					<u-icon name="close" size="34" color="#666666" @click="close"></u-icon>
				</view>
				<view class="flex-box">
					<slot></slot>
				</view>
				<view class="bottom" v-if="btnShow">
					<view class="btn" @click="sure">
						确认
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		props: {
			couponShow: {
				type: Boolean,
				default: false,
				required: true
			},
			title: {
				type: String,
				default: '',
				required: true
			},
			btnShow: {
				type: Boolean,
				default: true,
				required: true
			}
		},
		methods: {
			close() {
				this.$emit('close', false)
			},
			sure() {
				this.$emit('sure', false)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.coupon_pup {
		width: 750rpx;
		height: 1080rpx;
		border-radius: 16rpx 16rpx 0 0;

		.header_title {
			padding: 30rpx;
			display: flex;
			flex-direction: row;
			align-items: center;

			.left {
				font-size: 36rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				text-align: left;
				color: #333333;
				flex: 1;
			}
		}

		.flex-box {
			width: 100%;
			height: 55vh;
		}

		.bottom {
			width: 100%;
			height: 164rpx;
			padding-top: 24rpx;
			display: flex;
			justify-content: center;
			background: #ffffff;
			position: fixed;
			bottom: 0;

			.btn {
				width: 710rpx;
				height: 88rpx;
				background: #73F0EA;
				border-radius: 16rpx;
				font-size: 34rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #ffffff;
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}
	}
</style>